import os,time
import sys
from stmpa import Sendtomail
from spez import spdierweb


def DeltaSeconds():
    SECONDS_PER_DAY = 24 * 60 * 60
    from datetime import datetime, timedelta
    curTime = datetime.now()
    desTime = curTime.replace(hour=15, minute=30, second=0, microsecond=0)  #这里添加时间
    delta = desTime - curTime
    skipSeconds = delta.total_seconds() % SECONDS_PER_DAY
    print("Must sleep %d seconds" % skipSeconds)
    return skipSeconds


while True:

    s = DeltaSeconds()
    time.sleep(s)
    spdierweb()
    time.sleep(5)
    Sendtomail()
